﻿//===============================================================================
// Apolineo Patterns & Practices LeanEngine Framework
//===============================================================================
// Copyright © Apolineo Desenvolvimento de Sistemas Ltda.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using LeanEngine.SalesConcept.Entity;

namespace LeanEngine.SalesConcept.Windows
{
    //Formulário que contem a lógica de implementação da funcionalidade de seleção de um vendedor

    //executa uma pesquisa e retorna o item selecionado através da propriedade SelectedItem
    public partial class FormSelectSalesman : Component.FormSelectItemBase, Component.IFormSelectItemBehavior
    {
        public FormSelectSalesman()
        {
            InitializeComponent();
        }

        private void searchControlOfSalesman1_UpdateSalesman(LeanEngine.SalesConcept.Entity.Salesman obj)
        {
            this.SelectedItem = obj;
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        #region IFormSelectItemBehavior Members

        public LeanEngine.Entity.PlainEntity SelectedItem { get; private set; }

        #endregion
    }
}
